package screen;

import java.util.Random;

import resources.Assets;
import resources.IActivityRequestHandler;
import resources.Settings;

import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.OrthographicCamera;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.badlogic.gdx.graphics.g2d.TextureRegion;
import common.ActionResolver;
import common.Constant;
import common.GameConfig;


public class GameTetris extends Game {
	public static final String TAG = "Tetris extends Game";
	boolean firstTimeCreate = true;
	public static Random rand ;
	public static ActionResolver actionResolver;
	private IActivityRequestHandler requestHandler;
	
	public GameTetris()
	{
		
	}
	
	public GameTetris(ActionResolver resolver, IActivityRequestHandler handler)
	{
		actionResolver = resolver;
		requestHandler = handler;
	}
	
	public Texture loadTexture (String file) {
		return new Texture(Gdx.files.internal(file));
	}
	

	@Override
	public void create () {
		super.create();
		rand =  new Random();
		rand.setSeed(System.currentTimeMillis());
		GameConfig.load();
		Assets.load();
		Settings.load();
//		System.out.println("Hello");
		setScreen(new LoadGameScreen(this,requestHandler));
	}
	
	
	
	public void setScreen (Screen newScreen) {
		if (screen != null) screen.dispose();
		screen = newScreen;
	}

}